<template>
  <div class="tabs-box">
    <div class="item" v-for="item in list" :key="item.name" @click="movePosition(item)">
      {{ item.name }}
    </div>
  </div>
</template>
<script lang="ts" setup>
import { ref } from "vue";

const list = ref([
  { name: "云服务器", id: "server_m" },
  { name: "云市场", id: "market_m" },
  { name: "解决方案", id: "solution_m" },
  { name: "帮助中心", id: "help_m" },
]);

// 移动位置
const movePosition = (item) => {
  let temp: any = document.getElementById(item.id);
  temp.scrollIntoView({ block: "start", behavior: "smooth" });
};
</script>
<style lang="less" scoped>
.tabs-box {
  position: fixed;
  bottom: 100px;
  left: 0;
  z-index: 2000;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border-radius: 0 10px 10px 0;

  .item {
    color: #313131;
    font-size: 14px;
    padding: 30px 20px;
    background-color: #fff;
    text-align: center;
    &:hover {
      cursor: pointer;
      color: #4098ff;
      background: rgba(64, 152, 255, 0.1);
    }
  }
}
</style>
